import React from 'react'
import { useSelector, useDispatch } from 'react-redux'
import { increment } from '../../store/actions/calc'

export default function Test() {
  const dispatch = useDispatch()
  const count = useSelector((state) => state.calc)
  return (
    <div>
      <h3>{count}</h3>
      <button onClick={() => dispatch(increment(100))}>+100</button>
      <button onClick={() => dispatch({ type: 'INCREMENT', payload: 100 })}>
        +100
      </button>
    </div>
  )
}
